<?php
/*ini_set('display_errors','1'); ini_set('display_startup_errors','1'); */
/*************************************************************************
Index module
----------------------------------------------------------------
Vnnavi CMS Project
Company: Ava Co., Ltd                                  
Email: kimque@ava.vn                                    
Last updated: 08/03/201
**************************************************************************/
#chuyen muc sp
include_once(ROOT_PATH."classes/dao/productspromotion.class.php");
$productPromotion = new ProductPromotion();
$template->assign('productPromotion',$productPromotion);
include_once(ROOT_PATH."classes/dao/galleries.class.php");
$gallery = new Gallery();
$downloadAlbumItems= $gallery->getSubGallery(0);
$template->assign('downloadAlbumItems',$downloadAlbumItems);
#chuyen muc sp
include_once(ROOT_PATH."classes/dao/procategories.class.php");
$productcategories = new ProductCategories();
// menu san pham
$productcateItems = $productcategories->getObjects(1,"pid=0 AND status=1");
$template->assign('productcateItems',$productcateItems);
$template->assign('productcategories',$productcategories);
// menu lego
$legoItems = $productcategories->getObjects(1,"pid=1");
$template->assign('legoItems',$legoItems);
//VEX ROBOTICS
$vexRoboticsItems = $productcategories->getObjects(1,"pid=2");
$template->assign('vexRoboticsItems',$vexRoboticsItems);
//
$robotisItems = $productcategories->getObjects(1,"pid=3");
$template->assign('robotisItems',$robotisItems);
//
$template->assign('productcategories',$productcategories);
// banner
include_once(ROOT_PATH.'classes/dao/ads.class.php');
$ads = new Ads();
$adsItems = $ads->getObjects(1,"status =1 AND gid = 8",array('position'=>'ASC'),'');
$template->assign('adsItems',$adsItems); 
#supprot
$supportItems = $support->getObjects(1,"status =1",array('position'=>'ASC'),'');
$template->assign('supportItems',$supportItems);
#chuyen muc tin tuc
include_once(ROOT_PATH."classes/dao/categories.class.php");
$categories = new Categories();
$categoriesItems = $categories->getObjects(1,"status =1 AND pid=0 AND avatar=1",array('position'=>'ASC'),3);
$template->assign('categoriesItems',$categoriesItems);
#end tin tuc noi bat

#chuyen muc tin tuc
include_once(ROOT_PATH."classes/dao/entries.class.php");
$entries = new Entries();
$sub_idcate=$categories->getSubCategory1(4); 
$hotnewsItems = $entries->getObjects(1,"status =1 /*AND cid in($sub_idcate)*/",array('date_created'=>'DESC'),6);
$template->assign('hotnewsItems',$hotnewsItems);  
$template->assign('entries',$entries);  
#end tin tuc noi bat

?>